{% extends 'admin/layout.html.twig' %}

{% set menu = 'admin_setting_cloud_edulive' %}
{% set script_controller = 'setting/live-setting' %}

{% block page_title %}
  {% if setting('cloud_status.locked') == true %}
    <div class="alert alert-warning" role="alert">{{'admin.edu_cloud.edu_live.locked_tips'|trans}}</div>
    {{ currentMenu.code|parent_permission.name|trans }}
  {% elseif account.status|default() == 'none' %}
    <div class="alert alert-warning" role="alert">{{'admin.edu_cloud.edu_live.service_suspend'|trans}}</div>
    {{ currentMenu.code|parent_permission.name|trans }}
  {% else %}
    {{ parent() }}
  {% endif %}
{% endblock %}

{% block main %}
<!-- 设置 -->
{{ web_macro.flash_messages() }}
<form class="form-horizontal" id="live-setting-form" role="form" method="post" novalidate>
  <fieldset>
    <legend>{{'admin.edu_cloud.edu_live.switch_title'|trans}}</legend>

    <div class="form-group">
      <label for="" class="col-sm-3 control-label">{{'admin.edu_cloud.edu_live.edu_live_enable'|trans}}：</label>
      <div class="controls col-md-9 radios">
        <div>
          <span class="text-success">{{ 'admin.edu_cloud.edu_live.edu_live_enable_btn'|trans }}</span>
          <button type="submit" class="btn btn-default btn-sm mlm" name="live_course_enabled" value="0">
            <span class="text-muted">{{ 'admin.edu_cloud.edu_live.edu_live_close_btn'|trans }}</span>
          </button>
        </div>
        <div class="help-block">
          {{'admin.edu_cloud.edu_live.edu_live_tips'|trans({'%showUrl%': path('admin_cloud_show',{'type': 'live'})})|raw}}
        </div>
      </div>
    </div>
  </fieldset>

  {% if capacity.provider|default(0) == 'talkFun' %}
    <fieldset>
      <legend>{{ 'admin.edu_cloud.edu_live.base_setting'|trans }}</legend>

      <div class="form-group">
        <label for="" class="col-sm-3 control-label">{{'admin.edu_cloud.edu_live.live_logo_web'|trans}}：</label>
        <div class="controls col-md-9">
          <div class="logo-container-js">
            {% if liveCourseSetting.webLogoPath|default('') %}<img src="{{ asset(liveCourseSetting.webLogoPath) }}">{% endif %}
          </div>
          <a class="btn btn-default btn-sm" id="web-logo-upload"
          data-upload-token="{{ upload_token('system', 'image') }}"
          data-goto-url="{{ path('admin_cloud_edulive_logo_crop', {type: 'web'}) }}"
          >{{'admin.edu_cloud.edu_live.upload_btn'|trans}}</a>
          
          <p class="help-block">
            {{'admin.edu_cloud.edu_live.upload_web_tips'|trans|raw}}
          </p>
        </div>
      </div>
      <div class="form-group">
        <label for="" class="col-sm-3 control-label">{{'admin.edu_cloud.edu_live.live_logo_app'|trans}}：</label>
        <div class="controls col-md-9">
          <div class="logo-container-js">
            {% if liveCourseSetting.appLogoPath|default('') %}<img src="{{ asset(liveCourseSetting.appLogoPath) }}">{% endif %}
          </div>
          <a class="btn btn-default btn-sm" id="app-logo-upload"
          data-upload-token="{{ upload_token('system', 'image') }}"
          data-goto-url="{{ path('admin_cloud_edulive_logo_crop', {type:'app'}) }}"
          >{{'admin.edu_cloud.edu_live.upload_btn'|trans}}</a>
          
          <p class="help-block">
            {{'admin.edu_cloud.edu_live.upload_app_tips'|trans|raw}}
          </p>
        </div>
      </div>
      <div class="form-group">
        <label for="" class="col-sm-3 control-label">{{ 'admin.edu_cloud.edu_live.logo_url'|trans }}：</label>
        <div class="controls col-md-9">
          <input type="text" class="form-control width-input width-input-large" id="logoUrl" name="logoUrl" value="{% if liveCourseSetting.logoUrl|default('') != 'http://www.talk-fun.com' %}{{ liveCourseSetting.logoUrl|default('') }}{% endif %}" />
          <p class="help-block">
            {{'admin.edu_cloud.edu_live.logo_url_tips'|trans|raw}}
          </p>
        </div>
      </div>
    </fieldset>

    <div class="controls col-md-offset-3 col-md-8">
      <button type="submit" class="btn btn-primary save-btn" data-loading-text="{{ 'form.btn.submit.submiting'|trans }}">{{'form.btn.submit'|trans}}</button>
    </div>
  {% endif %}

  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>

{% endblock %}
